<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //前瞻运算符(?=规则), 匹配规则时不消耗字符
        let g = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@_,.$])[\dA-Za-z$@_,.]{6,12}$/    //密码只能包括数字,小写字母,大写字母,特殊字符
    </script>
</body>
</html>